//
//  CouponsTypeViewController.m
//  AnXin100
//
//  Created by Sakura on 2018/11/5.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "CouponsTypeViewController.h"
#import "CouponsTypeTableViewCell.h"
@interface CouponsTypeViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *mainTable;

@end

@implementation CouponsTypeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.mainTable];
}

- (UITableView *)mainTable {
    if (!_mainTable) {
        _mainTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, Hi-Hn - 44) style:UITableViewStylePlain];
        _mainTable.delegate = self;
        _mainTable.dataSource = self;
        _mainTable.separatorStyle = UITableViewCellSeparatorStyleNone;
        [_mainTable registerNib:[UINib nibWithNibName:@"CouponsTypeTableViewCell" bundle:nil] forCellReuseIdentifier:@"CouponsTypeTableViewCell"];
    }
    return _mainTable;
}

#pragma mark - UITableView Delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 120;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    CouponsTypeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CouponsTypeTableViewCell"];
    cell.type = _i;
    return cell;
}


@end
